package org.glxy;

import org.glxy.demo1.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@ResponseBody
public class Hello {
    @GetMapping("/aa")
    public String aa(){
        return "aa";
    }
    @GetMapping("/hh")
    public String hh(){
        return "hh111221113333";
    }

    @GetMapping("/hh1")
    public String hh1(String name,Integer age){
        return name + age + "hh1";
    }

    @GetMapping("/hh2")
    public String hh2(@RequestParam(value = "username",required = false) String name, Integer age){
        return name + age + "hh1";
    }

    @PostMapping("myp")
    public String myp(){
        return "myp";
    }

    @PostMapping("myp2")
    public String myp2(String username,String password){
        return username + " " + password;
    }

    @PostMapping("myp3")
    public String myp3(@RequestBody User user){
        return user.toString();
    }

}
